package com.dragon.codefx.dataBase.service.impl;

import com.dragon.codefx.dataBase.dao.SchemaTableConfigDao;
import com.dragon.codefx.dataBase.entity.SchemaTableConfigEntity;
import com.dragon.codefx.dataBase.service.SchemaTableConfigService;
import com.dragon.common.JpaServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 表配置 业务接口实现类
 *
 * @author lsc
 * @version V1.0
 * @date 2025-6-23
 */
@Slf4j
@Service
public class SchemaTableConfigServiceImpl extends JpaServiceImpl<SchemaTableConfigDao, SchemaTableConfigEntity, Integer> implements SchemaTableConfigService {

    @Override
    public SchemaTableConfigEntity findById(Integer tableConfigId) {
        return getJpaDao().findOneById(tableConfigId);
    }

    @Override
    public void delete(String schemaName, String tableName) {
        getJpaDao().deleteBySchemaNameAndTableName(schemaName, tableName);
    }

    @Override
    public SchemaTableConfigEntity findOne(String schemaName, String tableName) {
        return getJpaDao().findOneBySchemaNameAndTableName(schemaName, tableName);
    }
}